//
//  ChangeWalletVC.m
//  ShandsMod
//
//  Created by zh s on 2023/3/20.
//  Copyright © 2023 zh_s. All rights reserved.
//

#import "ChangeWalletVC.h"
#import "ChangeWalletListCell.h"

@interface ChangeWalletVC ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *mainTableView;
@property (nonatomic, strong) NSMutableArray *dataArr;

@end

@implementation ChangeWalletVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self data_init];
    self.navTitle = @"切换钱包";
    self.rightTitle = @"保存";
    self.view.backgroundColor = UIColor.whiteColor;
    self.isShadow = YES;
    [self UI_init];

    // Do any additional setup after loading the view.
}


#pragma mark ----- UI_init
- (void)UI_init {
    [self.view addSubview:self.mainTableView];
}
#pragma mark ----- data_init
- (void)data_init {
    self.dataArr = [NSMutableArray arrayWithCapacity:0];
}
#pragma mark ----- tableViewDelegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ChangeWalletListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    [cell setValueWithModel:indexPath.section];
    return cell;
    

}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return CGFLOAT_MIN;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    if (section == 0) {
        return 17;
    }
    
    return CGFLOAT_MIN;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    return nil;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    
    return nil;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
   
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 100;
}
#pragma mark ----- 点击事件
- (void)createWallet {
    
}
- (void)scanBtnClick {
    
}
#pragma mark ----- 点击事件
- (void)segmentViewChangeStateWithIndex:(NSInteger)index {
    [self.mainTableView reloadData];
}

- (void)rightViewClick {
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark ----- 懒加载
- (UITableView *)mainTableView {
    if (!_mainTableView) {
        _mainTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, NAV_HEIGHT +10, SCREEN_WIDTH, SCREEN_HEIGHT -NAV_HEIGHT) style:UITableViewStyleGrouped];
        _mainTableView.delegate = self;
        _mainTableView.dataSource = self;
        _mainTableView.showsVerticalScrollIndicator = NO;
        _mainTableView.rowHeight = 40;
        _mainTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _mainTableView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
        _mainTableView.backgroundColor = [UIColor whiteColor];
    
        [_mainTableView registerClass:[ChangeWalletListCell class]
               forCellReuseIdentifier:@"cell"];
    }
    return _mainTableView;
}


@end
